package com.ci.docker.registry.certificate;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 管理docker证书
 */
@RestController
@RequestMapping
public class CertificateController {

    @Autowired
    private CertificateService certificateService;

    @RequestMapping("list")
    public List<CertificateInfo> list() {
        return certificateService.list();
    }

    @RequestMapping("add")
    public String add(String name, List<MultipartFile> files) {
        return certificateService.add(name, files);
    }

    @RequestMapping("delete")
    public String delete(String name) {
        return certificateService.delete(name);
    }


}
